|
![](/i/fill.gif) |
Chris Huff wrote:
>
> In article <3A0FCAB9.D1347F95@online.no>, Tor Olav Kristensen
> <tor### [at] online no> wrote:
>
> > I wanted make some cylinders that were "bent" according to a random
> > pattern by using an iso- surface.
> > I haven't succeeded doing this yet, but here's an intermediate
> > result. I'm not sure at all if it's possible to do what I want with
> > an iso- surface. (But I'm trying.)
>
> It is very possible, and easy. Just use the pattern to adjust the xyz
> values fed to your function...the easiest way is to declare your
> function before you use it:
>
> #declare Cyl = function {1 - sqrt(sqr(x) + sqr(z))}
> #declare PatX = function {...pigment function for x displacement...}
> #declare PatY = function {...pigment function for y displacement...}
> #declare PatZ = function {...pigment function for z displacement...}
>
> isosurface {
> function {Cyl(x-PatX(x,y,z), y-PatY(x,y,z), z-PatZ(x,y,z))}
> ...
> }
This looks a bit similar to what I have been doing.
And I'm afraid that your bent cylinders will suffer
from the same flattening as mine when they are not
"moving" in the y-direction.
I.e.:
Their cross-section becomes oval, not circular.
But I'll try to use your code to verify this.
> This will do an effect similar to the type 0 displace warp...which leads
> to another way of doing it:
> #declare BentCyl =
> function {
> pigment {function {1 - sqrt(sqr(x) + sqr(z))}
> warp {displace {pigment...}}
> }
> }
>
> isosurface {
> function {Cyl(x, y, z)}
> ...
> }
I haven't explored warping yet,
but it seems fun.
Thank you for this suggestion
- I'll look into it.
Just a little question at the end:
Will expressions like this
1 - sqrt(sqr(x) + sqr(z)
evaluate faster than these
$ SphereFunction = function { "sphere" <0> }
1 - Spherefunction (x, 0, z)
?
Tor Olav
--
mailto:tor### [at] hotmail com
http://www.crosswinds.net/~tok/tokrays.html
Post a reply to this message
|
![](/i/fill.gif) |